import api from '../../api';
import { message } from 'antd';
export default {
  namespace: 'OTCOptionContractsMonitoringM',
  state: {
    dictionary: {}, //所有字典枚举
  },
  effects: {
    // 获取期权表格信息
    *queryOtcOptionMonitorList({ payload, callback }, { call, put }) {
      const response = yield call(api.OTCOptionContractsMonitoring.queryOtcOptionMonitorList, payload);

      if (response) {
        callback('success', response);
      } else {
        callback('fail');
        message.error((response && response.msg) || '获取列表失败');
      }
    },
  },

  reducers: {
    save(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },
  },
};
